Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

borc

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

borc

Encode and parse data in the Concise Binary Object Representation (CBOR) data format (RFC7049).

  • 2.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
135K
increased by45.13%
Maintainers
2
Weekly downloads
 
Created

What is borc?

The 'borc' npm package is a JavaScript library for encoding and decoding data in the CBOR (Concise Binary Object Representation) format. CBOR is a binary data serialization format similar to JSON but more compact, making it suitable for data exchange in constrained environments.

What are borc's main functionalities?

Encoding Data to CBOR

This feature allows you to encode JavaScript objects into the CBOR format. The code sample demonstrates encoding a simple object with a key-value pair into CBOR.

const cbor = require('borc');
const encoded = cbor.encode({ key: 'value' });
console.log(encoded);

Decoding CBOR Data

This feature allows you to decode CBOR data back into JavaScript objects. The code sample shows how to decode previously encoded CBOR data back into its original object form.

const cbor = require('borc');
const encoded = cbor.encode({ key: 'value' });
const decoded = cbor.decode(encoded);
console.log(decoded);

Streaming Decoding

This feature provides the ability to decode CBOR data from a stream, which is useful for processing large datasets or data received over a network. The code sample demonstrates setting up a stream decoder and processing encoded data.

const cbor = require('borc');
const { Decoder } = cbor;
const decoder = new Decoder();
decoder.on('data', (data) => console.log(data));
decoder.write(cbor.encode({ key: 'value' }));

Other packages similar to borc

Keywords

FAQs

Package last updated on 26 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc